﻿using System;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;

namespace ConfigByAppConfig
{
    class Program
    {
        static void Main(string[] args)
        {
            log4net.Config.XmlConfigurator.Configure();
            
            //var nhConfig = new Configuration().Configure();
            var nhConfig = new ConfigurationBuilder().Build();  // 프로그램 시작시간 단축..

            //log4net.ILog log = log4net.LogManager.GetLogger("This is debug point ---> ");
            //log.Debug("THis is tuenas's world!");
            //log.Info("How beautyful the console looks like");
            //log.Warn("You are great you did this");
            //log.Error("Who make you know is the best");
            //log.Fatal("tuenas the great");

            var sessionFactory = nhConfig.BuildSessionFactory();
            Console.WriteLine("NHibernate Configured!");
            Console.ReadKey();

            // NHibernate schema 생성.
            //var schemaExport = new SchemaExport(nhConfig);
            //schemaExport.Create(false, true);
            //schemaExport.SetOutputFile(@"db.sql").Execute(false, false, false);   // db script file 생성

            // NHibernate schema validate...
            var schemaValidator = new SchemaValidator(nhConfig);
            schemaValidator.Validate();



        }
    }
}